#!/bin/bash

#Check if the service 
function checkService {
        if [ $2 == on ]; then
                chkconfig --list | grep ${1}' ' | grep -q :on && echo The $1 service is turned on.
        else
                chkconfig --list | grep ${1}' ' | grep -q :on || echo The $1 service is either not turned on or not installed.
        fi
}

#changeOrAdd "fs.suid_dumpable" "fs.suid_dumpable = 0" /etc/sysctl.conf

function changeOrAdd {
	if ( grep -q "$1" $3 ); then
		( grep -q "$2" $3 ) || sed -i -re "s/$1/$2/" $3
	else
		echo "$2" >> $3
	fi
}